$(function(){
	$("#username").blur(function(){
		var that = this;
		$.ajax({
			url:"queryUser",
			type:"post",
			dataType:"json",
			data:{
				username:$(that).val()
			},
			success:function(response){
				if(response.success){
					$(that).addClass("success").removeClass("false");
				}else{
					$(that).addClass("false").removeClass("success");
				}
			}
		});
	});
	$(".submit").click(function(){
		if($("#username").hasClass("false")){
			return false;
		}else{
			$("#userform").submit();
		}
	});
})